package com.skt.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skt.domain.DTO.request.MerchantCostumeCreateRequest;
import com.skt.domain.DTO.request.MerchantCostumeUpdateRequest;
import com.skt.domain.PO.Costume;
import com.skt.domain.VO.MerchantBusinessStatisticsVO;
import com.skt.domain.VO.MerchantCostumeVO;
import com.skt.domain.VO.MerchantOrderVO;

import javax.validation.Valid;
import javax.validation.constraints.Min;

public interface MerchantService extends IService<Costume> {

    /**
     * 发布新服装
     * @param request
     * @return
     */
    MerchantCostumeVO publishCostume(@Valid MerchantCostumeCreateRequest request);


    /**
     *商家更新服装信息
     * @param id
     * @param request
     * @return
     */
    MerchantCostumeVO updateCostume(Long id, @Valid MerchantCostumeUpdateRequest request);


    /**
     * 下架服装
     * @param id
     * @return
     */
    MerchantCostumeVO offlineCostume(Long id);


    /**
     * 查询商家自己的服装列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    IPage<MerchantCostumeVO> listCostumesByMerchant(Integer pageNum, Integer pageSize);


    /**
     * 查询商家自己的订单列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    IPage<MerchantOrderVO> listOrdersByMerchant(Integer pageNum, Integer pageSize);


    /**
     * 确认发货
     * @param id
     */
    void shipOrder(@Min(value = 1, message = "订单ID必须为正整数") Long id);

    /**
     * 确认归还完成
     * @param id
     */
    void confirmReturnCompleted(@Min(value = 1, message = "订单ID必须为正整数") Long id);


    /**
     * 查看商家经营统计
     * @param startTime
     * @param endTime
     * @return
     */
    MerchantBusinessStatisticsVO getBusinessStatistics(String startTime, String endTime);
}
